Skip to content

Conversation

@jGauravGupta
Copy link
Contributor

Summary:

This PR updates the configuration logic to align with the version-specific property naming conventions introduced in the Payara Micro Maven Plugin.

Depending on the plugin version, system properties used to enable Dev Mode features will now automatically match the expected format.


Details:

🔹 For plugin version ≥ 2.5

Payara Micro Maven Plugin 2.5 introduced a new convention where system properties are prefixed with payara..

Example command:

mvn -Dpayara.hot.deploy=true \
    -Dpayara.deploy.war=true \
    -Dpayara.exploded=true \
    -Dpayara.trim.log=true \
    -Dpayara.auto.deploy=true \
    -Dpayara.keep.state=true \
    -Dpayara.live.reload=true \
    resources:resources compiler:compile war:exploded payara-micro:stop payara-micro:start

Code changes ensure that when the detected plugin version is 2.5 or later, the configuration uses these new prefixed property names (e.g. payara.hot.deploy, payara.deploy.war, etc.).

Note: Although plugin 2.5 is also backward compatible with the older (unprefixed) property names, using the payara. prefix is now preferred for consistency and forward compatibility.


🔹 For plugin version ≥ 2.1 and < 2.5

Earlier versions (starting from 2.1) introduced Dev Mode but used unprefixed property names.

Example command:

mvn -DhotDeploy=true \
    -DdeployWar=true \
    -Dexploded=true \
    -DtrimLog=true \
    -DautoDeploy=true \
    -DkeepState=true \
    -DliveReload=true \
    resources:resources compiler:compile war:exploded payara-micro:stop payara-micro:start

The logic now sets these unprefixed keys automatically for compatibility with 2.1–2.4.


🔹 For plugin version < 2.1

Dev Mode was not supported in versions earlier than 2.1, so Dev Mode-related properties are skipped.

Legacy properties like payaraVersion and hotDeploy are still set if provided to maintain basic compatibility, but Dev Mode-specific flags are ignored.


Motivation:

Ensures that NetBeans-generated Payara Micro Dev Mode configurations work seamlessly across all supported plugin versions, eliminating property mismatches and startup failures due to version differences.


Testing:

  • Verified with payara-micro-maven-plugin versions 2.0, 2.1, and 2.5
  • Confirmed that Dev Mode starts correctly with corresponding property names.
  • Tested backward compatibility where plugin 2.5 correctly accepts both prefixed and legacy properties.

@jGauravGupta jGauravGupta added the Java EE/Jakarta EE [ci] enable enterprise job label Oct 9, 2025
@matthiasblaesing
Copy link
Contributor

I looked through this and makes sense to me.

However testing is frustrating. I could not create a new payara micro project with the IDE. I built this branch and then activated the Enterprise cluster in the IDE.

Now choosing File -> Java with Maven -> Payara Micro Application fails

cd /tmp; JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64 /home/matthias/src/netbeans/nbbuild/netbeans/java/maven/bin/mvn -DarchetypeGroupId=fish.payara.starter -DarchetypeArtifactId=payara-starter-archetype -DarchetypeRepository=https://repo.maven.apache.org/maven2 -DgroupId=test -DartifactId=mavenproject2 -Dversion=1.0-SNAPSHOT -Dpackage=test.mavenproject2 -Dbasedir=/tmp -DpayaraMicroVersion=7.2025.1.Beta1 -DpayaraVersion=7.2025.1.Beta1 -DautoBindHttp=true -DcontextRoot=/ -Dplatform=micro -Darchetype.interactive=false -DarchetypeCatalog=local --batch-mode --no-transfer-progress org.apache.maven.plugins:maven-archetype-plugin:3.2.1:generate
...
Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.2.1:generate (default-cli) on project standalone-pom: The desired archetype does not exist (fish.payara.starter:payara-starter-archetype:1.0) -> [Help 1]

This is correct, there is only 1.0.0-beta16 on central. So I used that and that generates a broken project:

cd /tmp/mavenproject3; JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64 ./mvnw --no-transfer-progress install
Cannot run program "./mvnw" (in directory "/tmp/mavenproject3"): error=13, Keine Berechtigung

And indeed there is mvnw but it is not executable. I fixed that, but I think that should not happen in an archetype.

After that I noticed that the pom.xml defined a payara version, but that is not picked up:

grafik

@matthiasblaesing
Copy link
Contributor

For the build failure, to make github pickup changed labels, "Lock conversation" on this PR and unlock it again. That will trigger another build/check run, now with the updated labels.

@jGauravGupta jGauravGupta added this to the NB29 milestone Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Java EE/Jakarta EE [ci] enable enterprise job

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants